import {useEffect, useState} from "react";
import { StyleSheet, Text, View } from 'react-native';


export default function DemoView01({title,color}){

    const [titleNew, setTitleNew] = useState(title)

    useEffect(() => {
        setTimeout(()=>{
            setTitleNew(title+"-"+"New in 5s")
        },5000)
    }, [titleNew]);

    return <View style={[styles.body,{color:color}]} >
        <Text>{titleNew}</Text>
    </View>
}

const styles = StyleSheet.create({
    body:{
        width:"100%",
        height:100,

    }
})
